home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_01_07 / 1n07051a < prev    next >
Text File  |  1990-11-03  |  648b  |  30 lines

  1.  
  2.  
  3. /*************************************************
  4. * ADDNAME.C -- Add a local NETBIOS name.
  5. *
  6. *     Copyright 1990 Tom Jensen
  7. *************************************************/
  8.  
  9. #include <stdio.h>
  10. #include "netbios.h"
  11.  
  12. int IFLAG;
  13.  
  14. void main (int argc, char **argv)
  15. {
  16.   struct NcbData ncb;
  17.   unsigned  retcode;
  18.  
  19.   if (argc != 2)
  20.     printf ("Usage: addname {name to add}\n");
  21.   else if ((retcode = NbAddName (&ncb, argv[1])) == NB_OK)
  22.     printf ("Name \"%s\" added successfully.\n", argv[1]);
  23.   else
  24.   {
  25.     printf ("NETBIOS error %02xH encountered ", retcode);
  26.     printf ("while adding \"%s\".\n", argv[1]);
  27.   }
  28. }
  29.  
  30.